<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./base64.js"></script>
</head>

<body>
  <script>
    //1.加密
    var str = '124中文内容';
    var base = new Base64();
    var result = base.encode(str);
    document.write('加密', result);


    //2.解密
    var result2 = base.decode(result);
    document.write('解密', result2);
  </script>
</body>

</html>